@extends('master')
@section('title', trans('corebg.users.create.title'))
@section('content')
<div class="container col-md-6 col-md-offset-3">
  <div class="card mt-5">
      <div class="card-header">
          <h5 class="float-left">{{ trans('corebg.users.create.title') }}
            <a href="{{ $backurl }}">
              <span class="fas fa-arrow-circle-left" style="cursor:pointer" title="{{ trans('corebg.backurl') }}" >
              </span>
            </a>
          </h5>
      </div>
      <div class="card-body">
          <form class="form-horizontal" action="{{ action('UserController@store') }}" method="post">
              @include('shared.error-messages')
              @include('shared.flash-messages')
              {{ csrf_field() }}

              <div class="form-group">
                <label for="name" class="col-lg-12 control-label">{{ trans('corebg.users.create.name') }}</label>
                <div class="col-lg-12">
                    @if (@empty($resource))
                      <input type="text" class="form-control" id="name" name="name" >
                    @else
                      <input type="text" class="form-control" id="name" name="name" value="{{ $resource['name'] }}">
                    @endif
                </div>
              </div>
              <div class="form-group">
                  <label for="email" class="col-lg-12 control-label">{{ trans('corebg.users.create.email') }}</label>
                  <div class="col-lg-12">
                      @if (@empty($resource))
                        <input type="email" class="form-control" id="email" name="email" >
                      @else
                        <input type="email" class="form-control" id="email" name="email" value="{{ $resource['email'] }}">
                      @endif
                  </div>
              </div>
              <div class="form-group">
                <label for="password" class="col-lg-12 control-label">{{ trans('corebg.users.create.password') }}</label>
                <div class="col-lg-12">
                    @if (@empty($resource))
                      <input type="password" class="form-control" id="password" name="password">
                    @else
                      <input type="password" class="form-control" id="password" name="password" value="{{ $resource['password'] }}">
                    @endif
                </div>
              </div>
              <div class="form-group">
                <div class="col-lg-12">
                  <button type="submit" class="btn btn-primary">{{ trans('corebg.save') }}</button>
                </div>
              </div>
          </form>
      </div>
  </div>
</div>
@endsection
